Class NewsResponseProcessorTest

java.lang.Object
com.fsf.news.processor.NewsResponseProcessorTest

@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) class NewsResponseProcessorTest extends Object
Unit tests for the NewsResponseProcessor class.
  • Field Details

    • responseProcessor

      @InjectMocks com.fsf.news.processor.NewsResponseProcessor responseProcessor
    • objectMapper

      @Mock com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • objectReader

      @Mock com.fasterxml.jackson.databind.ObjectReader objectReader
    • jsonNode

      @Mock com.fasterxml.jackson.databind.JsonNode jsonNode
    • arrayNode

      @Mock com.fasterxml.jackson.databind.node.ArrayNode arrayNode
    • objectNode

      @Mock com.fasterxml.jackson.databind.node.ObjectNode objectNode
  • Constructor Details

    • NewsResponseProcessorTest

      NewsResponseProcessorTest()
  • Method Details

    • testProcessResponse

      @Test void testProcessResponse() throws IOException
      Tests that the processResponse method returns the expected results.
      Throws:
      IOException - If JSON processing fails
    • testProcessResponseExceptionArticle

      @Test void testProcessResponseExceptionArticle() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processResponse method throws exceptionally from processing the response to an Article.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessResponseExceptionSearchResult

      @Test void testProcessResponseExceptionSearchResult() throws IOException
      Tests that the processResponse method throws exceptionally from processing the response to a SearchResult.
      Throws:
      IOException - If JSON processing fails
    • testProcessSourcesResponse

      @Test void testProcessSourcesResponse() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourcesResponse method returns the expected results.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessSourcesResponseExceptionSource

      @Test void testProcessSourcesResponseExceptionSource() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourcesResponse method throws exceptionally from processing the response to a Source.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessSourcesResponseExceptionSourcesResult

      @Test void testProcessSourcesResponseExceptionSourcesResult() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourcesResponse method throws exceptionally from processing the response to a SourcesResult.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessSourceProfileResponsesNormal

      @Test void testProcessSourceProfileResponsesNormal() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourceProfileResponses method returns the expected results.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessSourceProfileResponsesSourceNotFound

      @Test void testProcessSourceProfileResponsesSourceNotFound() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourceProfileResponses method returns a default source when the specified source is not found.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessSourceProfileResponsesArticleException

      @Test void testProcessSourceProfileResponsesArticleException() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourceProfileResponses method throws ResponseProcessingException when article processing fails.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails
    • testProcessSourceProfileResponsesSourceException

      @Test void testProcessSourceProfileResponsesSourceException() throws com.fasterxml.jackson.core.JsonProcessingException
      Tests that the processSourceProfileResponses method throws ResponseProcessingException when source processing fails.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - If JSON processing fails